package Model.MarketPlace;

import Model.Planet.Planet.CR;
import Model.Planet.Planet.IE;
import Model.Planet.Planet.Resource;

/**
 * @author Waseem
 * @version 1.0
 *
 */
public class Item  {

	/**
	 * Name of the item
	 */
	private String name;

	/**
	 * price of item
	 */
	private int price;

	/**
	 * A short description of item
	 */
	private String description;

	/**
	 * quantity of item
	 */
	private int quantity;

	/**
	 * the minimum tech level to produce
	 */
	private int minTechProduce; 

	/**
	 *  minimum tech level to use
	 */
	private int minTechUse; 

	/**
	 *  tech level which produces most of this item
	 */
	private int ttp; 

	/**
	 * price increase per tech level
	 */
	private int ipl; 

	/**
	 * maximium percentage price can go above/below its base price
	 */
	private int variance; 

	/**
	 * ie level
	 */
	private IE ie;

	/**
	 *  cr level
	 */
	private CR cr;

	/**
	 *  resource of the planet
	 */
	private Resource er;

	/**
	 * @param name
	 * @param price
	 * @param quantity
	 * @param mtlp
	 * @param mtlu
	 * @param ttp
	 * @param ipl
	 * @param variance
	 * @param ie
	 * @param cr
	 * @param er
	 */
	public Item(String name, int price, int quantity, int mtlp, int mtlu, 
	        int ttp, int ipl, int variance, IE ie, CR cr, Resource er){
		this.name = name;
		this.price = price;
		this.minTechProduce = mtlp;
		this.minTechUse = mtlu;
		this.ttp = ttp;
		this.ipl = ipl;
		this.variance = variance;
		this.description = "Add it later";
		this.ie = ie;
		this.cr = cr;
		this.er = er;
		this.quantity = quantity;
	}

	/**
	 * @return array of all possible items in game
	 */
	public static Item[] getItemList(){
		final Item[] list = 
			{new Item("Water", 30, 100, 0, 0, 2, 3, 4, 
			        IE.DROUGHT, CR.LOTSOFWATER, Resource.DESERT ),
		     new Item("Furs", 250, 50, 0, 0, 0, 10, 10, 
		             IE.COLD, CR.RICHFAUNA, Resource.LIFELESS), 
		     new Item("Food", 100, 100, 1, 0, 1, 5, 5, 
		             IE.CROPFAIL, CR.RICHSOIL, Resource.POORSOIL),
		     new Item("Ore", 350, 45, 2, 2, 3, 20, 10, 
		             IE.WAR, CR.MINERALRICH, Resource.MINERALPOOR),
		     new Item("Games", 250, 50, 3, 1, 6, -10, 5, 
		             IE.BOREDOM, CR.ARTISTIC, Resource.NOSPECIALRESOURCES ),
		     new Item("Firearms", 1250, 25, 3, 1, 5, -75, 100, 
		             IE.WAR, CR.WARLIKE, Resource.NOSPECIALRESOURCES),
			 new Item("Medicine", 650, 25, 4, 1, 6, -20, 10, 
			         IE.PLAGUE, CR.LOTSOFHERBS, Resource.NOSPECIALRESOURCES),
			 new Item("Machines", 900, 20, 4, 3, 5, -30, 5, 
			         IE.LACKOFWORKERS, CR.NEVER, Resource.NOSPECIALRESOURCES),
			 new Item("Narcotics", 3500, 10, 5, 0, 5, -125, 150, 
			         IE.BOREDOM, CR.WEIRDMUSHROOMS, Resource.NOSPECIALRESOURCES),
			 new Item("Robots", 5000, 5, 6, 4, 7, -150, 100, 
			         IE.LACKOFWORKERS, CR.NEVER, Resource.NOSPECIALRESOURCES)  
			};
		
		return list;
	}
	
	/**
	 * getter for the ie
	 * @return ie
	 */
	public IE getIe() {
		return ie;
	}

	/**
	 * setter for ie
	 * @param ie
	 */
	public void setIe(IE ie) {
		this.ie = ie;
	}

	/**
	 * getter for cr
	 * @return cr
	 */
	public CR getCr() {
		return cr;
	}

	/**
	 * setter for cr
	 * @param cr
	 */
	public void setCr(CR cr) {
		this.cr = cr;
	}
	
	/**
	 * getter for quantity
	 * @return quantity
	 */
	public int getQuantity() {
		return quantity;
	}

	/**
	 * setter for quantity
	 * @param quantity
	 */
	public void setQuantity(int quantity) {
		this.quantity = quantity;
	}

	/**
	 * getter for resource
	 * @return er
	 */
	public Resource getEr() {
		return er;
	}

	/**
	 * setter for resource
	 * @param er
	 */
	public void setEr(Resource er) {
		this.er = er;
	}

	/**
	 * getter for name
	 * @return name
	 */
	public String getName() {
		return name;
	}

	/**
	 * setter for name
	 * @param name
	 */
	public void setName(String name) {
		this.name = name;
	}

	/**
	 * getter for price
	 * @return price
	 */
	public int getPrice() {
		return price;
	}

	/**
	 * setter for price
	 * @param price
	 */
	public void setPrice(int price) {
		this.price = price;
	}

	/**
	 * getter for mtlp
	 * @return mtlp
	 */
	public int getMinTechProduce() {
		return minTechProduce;
	}

	/**
	 * setter for mtlp
	 * @param mtlp
	 */
	public void setMinTechProduce(int mtlp) {
		this.minTechProduce = mtlp;
	}

	/**
	 * getter for mtlu
	 * @return mtlu
	 */
	public int getMtlu() {
		return minTechUse;
	}

	/**
	 * setter for mtlu
	 * @param mtlu
	 */
	public void setMtlu(int mtlu) {
		this.minTechUse = mtlu;
	}

	/**
	 * getter for ttp
	 * @return ttp
	 */
	public int getTtp() {
		return ttp;
	}

	/**
	 * setter for ttp
	 * @param ttp
	 */
	public void setTtp(int ttp) {
		this.ttp = ttp;
	}

	/**
	 * getter for ipl
	 * @return ipl
	 */
	public int getIpl() {
		return ipl;
	}

	/**
	 * setter for ipl
	 * @param ipl
	 */
	public void setIpl(int ipl) {
		this.ipl = ipl;
	}

	/**
	 * getter for variance
	 * @return variance
	 */
	public int getVariance() {
		return variance;
	}

	/**
	 * setter for variance
	 * @param variance
	 */
	public void setVariance(int variance) {
		this.variance = variance;
	}

	/**
	 * getter for description
	 * @return description
	 */
	public String getDescription() {
		return description;
	}

	/**
	 * setter for description
	 * @param description
	 */
	public void setDescription(String description) {
		this.description = description;
	}
	
	/* (non-Javadoc)
	 * @see java.lang.Object#toString()
	 */
	public String toString(){
		return super.toString();
	}
}
